import { createPinia } from "pinia";
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
import type { App } from "vue";

// 定义持久化存储的键
export const userKey = "pure-user";
export const epThemeKey = "pure-epTheme";
export const appLayoutKey = "pure-layout";
export const settingsKey = "pure-settings";
export const tagsKey = "pure-tags";

const store = createPinia();
store.use(piniaPluginPersistedstate);

export function setupStore(app: App<Element>) {
  app.use(store);
}

export { store };
